package cn.edu.wfu.libautobook.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.Date;

@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName("wfu_user")
public class User implements Serializable {
    // User Id
    @TableId(type = IdType.AUTO)
    Integer uid;
    // User Name
    String username;
    // User Password
    String password;
    // User Salt
    String salt;
    // User Pid
    Integer pid;
    // User Level
    Integer level;
    // User Register Time
    Date registerTime;
    // User Last Login Time
    Date lastLogin;
    // User Last Token
    String lastToken;
    // Email
    String email;

    public User(Integer uid, String username, String password, String salt, Integer pid, Integer level, Date registerTime, Date lastLogin, String lastToken, String email) {
        this.uid = uid;
        this.username = username;
        this.password = password;
        this.salt = salt;
        this.pid = pid;
        this.level = level;
        this.registerTime = registerTime;
        this.lastLogin = lastLogin;
        this.lastToken = lastToken;
        this.email = email;
    }

    public User() {
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

    public Date getLastLogin() {
        return lastLogin;
    }

    public void setLastLogin(Date lastLogin) {
        this.lastLogin = lastLogin;
    }

    public String getLastToken() {
        return lastToken;
    }

    public void setLastToken(String lastToken) {
        this.lastToken = lastToken;
    }

    @Override
    public String toString() {
        return "User{" +
                "uid=" + uid +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", pid=" + pid +
                ", level=" + level +
                ", registerTime=" + registerTime +
                ", lastLogin=" + lastLogin +
                ", lastToken='" + lastToken + '\'' +
                '}';
    }
}
